package org.fao.pims.web.pollinteractions;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class SpeciesForm extends ActionForm {

	private String name = "";
	private String scientificName;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public void reset(ActionMapping mapping, HttpServletRequest request)
	{
		
		name = null;
		
		
		
	}
	
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
	{
		ActionErrors errors = new ActionErrors();
		
		
		
		if( (name == null) || name.trim().equals(""))
		{
			errors.add("name", new ActionMessage("speciesInteractions.name.blank"));
		}
		
		
		return errors;
	}

	public String getScientificName() {
		return scientificName;
	}

	public void setScientificName(String scientificName) {
		this.scientificName = scientificName;
	}


}
